<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>会员注册-会员中心-全球电动车网</title>
		<meta name="title" content="会员注册-会员中心-全球电动车网">
		<meta name="keyword" content="电动车会员,企业会员,招商通会员,招商通高级会员,网购通会员,网购通高级会员,免费会员,招商通服务,网络招商,网上招聘,网络问答,杂志广告,网站广告">
		<meta name="description" content="全球电动车网会员注册,会员信息,会员服务,提供会员专区,网上招聘,发布网络招商,网络问答,有杂志广告,网站广告等服务">
    <link href="/reg/css/reg.css" rel="stylesheet" type="text/css" />
	<script type='text/javascript' src='/dwr/interface/CountryAreaSelect.js'></script>
	<script type='text/javascript' src='/dwr/engine.js'></script>
	<script type='text/javascript' src='/dwr/util.js'></script>
	<script type="text/javascript">
		function getAllProv() {
		    CountryAreaSelect.getAllProvinces(provSelectOptions);
		 }
		 
		 function getCiytByProvId(provID){
		    CountryAreaSelect.getAllCitiesByProvinceId(provID,citySelectOptions);
		 }
		 
		 function getDiquByCityId(cityID){
		    CountryAreaSelect.getAllDiquesByCityId(cityID,diquSelectOptions);
		 }
		 
		 function provSelectOptions(provList){
		     DWRUtil.removeAllOptions("provid");
		     DWRUtil.addOptions("provid", provList);   
		 }
		 
		 function citySelectOptions(cityList){
		      DWRUtil.removeAllOptions("cityid");
		      DWRUtil.removeAllOptions("diquid"); 
		      DWRUtil.addOptions("cityid", cityList); 
		 }
		 
		  function diquSelectOptions(diquList){
		      DWRUtil.removeAllOptions("diquid");
		      DWRUtil.addOptions("diquid", diquList); 
		 }
 
		 function getProvSelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getCiytByProvId(id);
			       }
		       }
		 }
		 
		  function getCitySelected(selectObj){
		       for(var i = 0; i < selectObj.options.length; i++){
			       if (selectObj.options[i].selected){
			         var id = selectObj.options[i].value;
			          getDiquByCityId(id);
			       }
		       }
		 }
		 
		  function checkReg(){
				var cpName = document.getElementById("cpName");	
				if(cpName.value == ''){
					window.alert('请输入企业名称');
					cpName.focus();
					return  false;
				}
				
			    var cpPass = document.getElementById("cpPass");	
			    if(cpPass.value==''){
				       window.alert('请输入密码');
				       cpPass.focus();
				       return false;
			   }
			    if(cpPass.value.length<6 || cpPass.value.length>12){
				       window.alert('密码长度需在6-12之间');
				       cpPass.focus();
				       return false;
			   }
			   
			   var confirmPass = document.getElementById("confirmPass");	
			   if(confirmPass.value=='') {
				       window.alert('请输入确认密码');
				       confirmPass.focus();
				       return  false;
			   }
			   if(confirmPass.value.length<6 || confirmPass.value.length>12){
				       window.alert('密码长度需在6-12之间');
				       confirmPass.focus();
				       return false;
			   }
			
				var confirmPass = document.getElementById("confirmPass");	
				if(cpPass.value != confirmPass.value){
				       window.alert('两次密码不一致，请重新输入');
				       cpPass.focus();
				       return  false;
			   }
			   
			   var provid = document.getElementById("provid");	
			   if(provid.value=='') {
				       window.alert('请选择省份');
				       provid.focus();
				       return  false;
			   }
			   
			   var cityid = document.getElementById("cityid");	
			   if(cityid.value=='') {
				       window.alert('请选择城市');
				       cityid.focus();
				       return  false;
			   }
			   
			   var qiyemail = document.getElementById("cpMail");	
			   if(qiyemail.value == ""){
					alert('为了你的帐号安全：请正确填写E-Mail！');
					qiyemail.focus();
					return false;
				}else if(qiyemail.value.indexOf('@')== -1 ||qiyemail.value.indexOf('.')== -1){
					alert('为了你的帐号安全：请正确填写E-Mail！');
					qiyemail.focus();
					return false;
				}
			   
				return true;
			}
			
			function typeChange(obj){
				if(obj != null && obj != ''){
					if(obj == 2){
						document.getElementById("logo").disabled = true;
						document.getElementById("img").disabled = true;
						document.getElementById("shopHeadImage").disabled = true;
					}else{
						document.getElementById("logo").disabled = false;
						document.getElementById("img").disabled = false;
						document.getElementById("shopHeadImage").disabled = false;
					}
				}
			}
			
		</script>
		
</head>

<body>

	<div class="reg_sm">
	
		<html:form action="/EBBQyRegAction.do?action=reg" method="post" enctype="multipart/form-data" onsubmit="return checkReg();">
		
    	<div class="reg_tx">
	   		<h1>基本信息　　　　<span id="error" style="color: red;font-size: 14px;"></span></h1>
			   <ul>
			      <li style="width:70px;">企业名称：</li>
				  <li><html:text property="cpName" maxlength="50" size="50" value=""/>
				  <html:hidden property="cpPass" value="123456"/>
				  <html:hidden property="confirmPass"  value="123456"/>
				  &nbsp;<font color="red">*</font></li>
			   </ul>
				<ul>
			      <li style="width:70px;">E-mail：</li>
			      <li><html:text property="cpMail" maxlength="30" value=""/>&nbsp;<font color="red">*</font></li>
			   </ul>
</div>

		<div class="reg_tx">
	   
	   <h1>企业基本信息</h1>
	   
	   <ul>
	      <li style="width:70px;">是否锁定：</li>
		  <li>
		  	<input type="radio" name="ifsd" value="1" checked="checked"/>是
		  	<input type="radio" name="ifsd" value="0"/>否
		  </li>
	   </ul>
	   
	   <ul>
	      <li style="width:70px;">是否删除：</li>
		  <li>
		  	<input type="radio" name="ifdel" value="1" />是
		  	<input type="radio" name="ifdel" value="0" checked="checked"/>否
		  </li>
	   </ul>
	   
	   <ul>
	      <li style="width:70px;">是否审核：</li>
		  <li>
		  	<input type="radio" name="ifCheck" value="1"/>是
		  	<input type="radio" name="ifCheck" value="0" checked="checked"/>否
		  </li>
	   </ul>
	   
	   <ul>
	      <li style="width:70px;">是否推荐：</li>
		  <li>
		  	<input type="radio" name="isCommend" value="1"/>是
		  	<input type="radio" name="isCommend" value="0" checked="checked"/>否
		  </li>
	   </ul>
	   
	   <ul>
	      <li style="width:70px;">会员性质：</li>
		  <li>
		    <input type="radio" name="regType" value="1" checked />招商通
		    <input type="radio" name="regType" value="2"/>网购通
		  </li>
		  <li style="margin-left:8px;"></li>
	   </ul>
	   
	   <ul>
	      <li style="width:70px;">企业类型：</li>
		  <li>
		    <label>
		    <select name="cpFl" id="cpFl" onchange="typeChange(this.value);">		    	
		       <option value="0" <c:if test="${dealerForm.cpFl == 0}">selected</c:if>>整车企业</option>
		       <option value="1" <c:if test="${dealerForm.cpFl == 1}">selected</c:if>>配件企业</option>
		       <option value="2" <c:if test="${dealerForm.cpFl == 2}">selected</c:if>>经销商</option>
		       <option value="3" <c:if test="${dealerForm.cpFl == 3}">selected</c:if>>商业市场</option>
		       <option value="4" <c:if test="${dealerForm.cpFl == 4}">selected</c:if>>其他</option>
		       <option value="5" <c:if test="${dealerForm.cpFl == 5}">selected</c:if>>行业机构</option>
		       <option value="6" <c:if test="${dealerForm.cpFl == 6}">selected</c:if>>外贸单位</option>
		    </select>
		    </label>
		  </li>
		  <li style="margin-left:8px;"></li>
	   </ul>
	   
	   
	   <ul>
	      <li style="width:70px;">联 系 人：</li>
	      <li><html:text property="linkname" maxlength="30"/></li>
	   </ul>
	   <ul>
	      <li style="width:75px;">联系人职务：</li>
	      <li><html:text property="linkzhi" maxlength="20"/></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司LOGO：</li>
		  <li><input type="file" name="logo" id="logo"/></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司图片：</li>
		  <li><input type="file" name="img" id="img"/></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">商铺图片：</li>
		  <li><input type="file" name="shopHeadImage" id="shopHeadImage"/></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">所属省市：</li>
		  <li>
		    <html:select property="provid" onchange="getProvSelected(this);">
		    	<html:optionsCollection name="provlist" label="prov" value="provId"/>
		    </html:select>
		  	<html:select property="cityid" onchange="getCitySelected(this);">
		  		<html:optionsCollection name="citylist" label="city" value="cityId"/>
		  	</html:select>
		  	<html:select property="diquid">
		  		<html:optionsCollection name="diqulist" label="diquming" value="diquId"/>
		  	</html:select>
		  </li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司地址：</li>
		  <li><html:text property="address" size="30" maxlength="50" /></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司网站: </li>
		  <li><html:text property="qyhttp" size="30" maxlength="50" /></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司邮编：</li>
	      <li><html:text property="code" size="30" maxlength="10" /></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">联系电话：</li>
	      <li><html:text property="tel" size="30" maxlength="20" /></li>
	   </ul>
	   <ul>
	      <li style="width:70px;">公司传真：</li>
		  <li><html:text property="fax" size="30" maxlength="20" /></li>
	   </ul>
	   
	   <div style="clear:both"></div>
	</div>
		
	<div>
		<img src="/reg/images/line.gif" width="966" height="1" />
	</div>
	
	
	<div><img src="/reg/images/line.gif" width="966" height="1" /></div>


	<div class="reg_bottom">
        <html:image src="/reg/images/bottom_2-1.gif" border="0"></html:image>    	
    </div>
    
    </html:form>
    
</div>
	
		<logic:present name="msg">
			<bean:write name="msg" filter="false"/>
		</logic:present>

</body>
</html>
